<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="admin/include :: header('新增OEM')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-unit-add" name="form-unit-add">
        <div class="form-group">	
            <label class="col-sm-3 control-label is-required">OEM名称：</label>
            <div class="col-sm-8">
                <input id="unitName" name="unitName" class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group">	
            <label class="col-sm-3 control-label is-required">负责人：</label>
            <div class="col-sm-8">
                <input id="principal" name="principal" class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group">	
            <label class="col-sm-3 control-label is-required">手机号码：</label>
            <div class="col-sm-8">
                <input id="phone" name="phone" class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group">	
            <label class="col-sm-3 control-label is-required">地址：</label>
            <div class="col-sm-8">
                <input id="address" name="address" class="form-control" type="text" required>
            </div>
        </div>
		<div class="form-group">	
            <label class="col-sm-3 control-label">备注：</label>
            <div class="col-sm-8">
                <textarea id="remark" name="remark" class="form-control"></textarea>
            </div>
        </div>
    </form>
    </div>
    <th:block th:include="admin/include :: footer" />
    <script type="text/javascript">
	    var prefix = ctx + "admin/sys/unit";
	
	    $("#form-unit-add").validate({
	    	onkeyup: false,
	        rules: {
	            configKey: {
	                /* remote: {
	                    url: prefix + "/checkConfigKeyUnique",
	                    type: "post",
	                    dataType: "json",
	                    data: {
	                        "configKey": function() {
	                            return $.common.trim($("#configKey").val());
	                        }
	                    },
	                    dataFilter: function(data, type) {
	                        return $.validate.unique(data);
	                    }
	                } */
	            },
	        },
	        messages: {
	            "configKey": {
	                remote: "参数键名已经存在"
	            }
	        },
	        focusCleanup: true
	    });
	    
	    function submitHandler() {
	        if ($.validate.form()) {
	            $.operate.save(prefix + "/add", $('#form-unit-add').serialize());
	        }
	    }
    </script>
</body>
</html>
